//
//  ContactUsViewController.m
//  TenThousand
//
//  Created by 宁宁 on 16/7/25.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "ContactUsViewController.h"

@interface ContactUsViewController ()

@end

@implementation ContactUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"联系我们";
    
    self.view.backgroundColor = [UIColor colorWithRed:237/255.0 green:237/255.0 blue:237/255.0 alpha:1];
    
    [self setView];
}

- (void)setView{
    
    UILabel *title1 = [[UILabel alloc] initWithFrame:CGRectMake(8, 15, Screen_Width - 16, 20)];
    title1.text = @"客户服务";
    title1.font = [UIFont boldSystemFontOfSize:16];
    [self.view addSubview:title1];
    
    UIView *bgview1 = [[UIView alloc] initWithFrame:CGRectMake(8, title1.frame.origin.y + title1.frame.size.height + 10, Screen_Width - 16, 1000)];
    bgview1.backgroundColor = [UIColor whiteColor];
    
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(12, 12, Screen_Width - 24 - 16, Screen_Height)];
    label1.font = [UIFont systemFontOfSize:14];
    label1.numberOfLines = 0;
    NSString *phone = @"客服热线：400-139-3399\n客服邮箱：kefu@wanyuanfu.net";
    //设置label行距
    NSMutableAttributedString *attributedString1 = [[NSMutableAttributedString alloc] initWithString:phone];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:9];
    [attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [phone length])];
    label1.attributedText = attributedString1;
    [label1 sizeToFit];
    
    bgview1.frame = CGRectMake(8, title1.frame.origin.y + title1.frame.size.height + 10, Screen_Width - 16, label1.frame.size.height + 24);
    [bgview1 addSubview:label1];
    [self.view addSubview:bgview1];
    
    
    
    UILabel *title2 = [[UILabel alloc] initWithFrame:CGRectMake(8, bgview1.frame.origin.y + bgview1.frame.size.height + 20, Screen_Width - 16, 20)];
    title2.text = @"联系地址";
    title2.font = [UIFont boldSystemFontOfSize:16];
    [self.view addSubview:title2];
    
    UIView *bgview2 = [[UIView alloc] initWithFrame:CGRectMake(8, title2.frame.origin.y + title2.frame.size.height + 10, Screen_Width - 16, 1000)];
    bgview2.backgroundColor = [UIColor whiteColor];
    
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(12, 12, Screen_Width - 24 - 16, Screen_Height)];
    label2.font = [UIFont systemFontOfSize:14];
    label2.numberOfLines = 0;
    NSString *address = @"杭州市江干区天城东路\n183号中沙时代银座8楼";
    //设置label行距
    NSMutableAttributedString *attributedString2 = [[NSMutableAttributedString alloc] initWithString:address];
    [attributedString2 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [address length])];
    label2.attributedText = attributedString2;
    [label2 sizeToFit];
    
    bgview2.frame = CGRectMake(8, title2.frame.origin.y + title2.frame.size.height + 10, Screen_Width - 16, label2.frame.size.height + 24);
    [bgview2 addSubview:label2];
    [self.view addSubview:bgview2];
}

@end
